import { createRouter, createWebHistory } from "vue-router";
// import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),

  routes: [
    {
      path: "/",
      name: "NFT",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/NFTView.vue"),
    },
    {
      path: "/My",
      name: "My",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/MyView.vue"),
      meta: {
        requireAuth: true,
      },
    },
    {
      path: "/CreateNFT",
      name: "CreateNFT",
      // route level code-split../views/NFTView.vue
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/CreateNFTView.vue"),
      meta: {
        requireAuth: true,
      },
    },
    {
      path: "/Login",
      name: "Login",
      // route level code-split../views/NFTView.vue
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/LoginView.vue"),
    },
    {
      path: "/About",
      name: "about",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/AboutView.vue"),
      meta: {
        requireAuth: true,
      },
    },
    {
      path: "/Registe",
      name: "Registe",
      // route level code-split../views/NFTView.vue
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/RegisteView.vue"),
    },
    {
      path: "/ChangeName",
      name: "ChangeName",
      // route level code-split../views/NFTView.vue
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/ChangeNameView.vue"),
      meta: {
        requireAuth: true,
      },
    },
  ],
});

export default router;
